package com.bleeth.fx.component;

import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.layout.Region;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import lombok.Builder;


/**
 * @author Sakura
 * @version 1.0
 * @date 2021-11-13 22:17
 **/
@Builder
public class MText {

    @Builder.Default
    private String color = "#33302d";

    @Builder.Default
    private String text = "";

    @Builder.Default
    private double size = 14;

    @Builder.Default
    private Pos pos = Pos.CENTER_LEFT;

    private Label textRegion;

    public Region make() {
        textRegion = new Label();
        textRegion.setText(text);
        textRegion.setTextFill(Color.web(color));
        textRegion.setFont(Font.font(size));
        textRegion.setAlignment(pos);
        return textRegion;
    }

}
